<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
  <title>Description of tt_qreshape</title>
  <meta name="keywords" content="tt_qreshape">
  <meta name="description" content="Reshapes the cores of the input (Q)TT representation.">
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta name="generator" content="m2html v1.5 &copy; 2003-2005 Guillaume Flandin">
  <meta name="robots" content="index, follow">
  <link type="text/css" rel="stylesheet" href="../../m2html.css">
</head>
<body>
<a name="_top"></a>
<div><a href="../../index.html">Home</a> &gt;  <a href="#">tt2</a> &gt; <a href="index.html">core</a> &gt; tt_qreshape.m</div>

<!--<table width="100%"><tr><td align="left"><a href="../../index.html"><img alt="<" border="0" src="../../left.png">&nbsp;Master index</a></td>
<td align="right"><a href="index.html">Index for tt2/core&nbsp;<img alt=">" border="0" src="../../right.png"></a></td></tr></table>-->

<h1>tt_qreshape
</h1>

<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="box"><strong>Reshapes the cores of the input (Q)TT representation.</strong></div>

<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="box"><strong>function [tt]=tt_qreshape(tt,s,sz) </strong></div>

<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="fragment"><pre class="comment"> Reshapes the cores of the input (Q)TT representation.
 s (scalar) is the number of mode indices in each core of the input representation;
 sz is a matrix of size d x s1, where d is the number of cores and s1 is the number of mode indices in each core of the output representation;
 sz(k,alpha) is the mode size of the alpha-th index in the k-th core of the output representation.
 k-th component of prod(sz,2) is the overall numbers of mode degrees of freedom of the k-th core of the output representation 

 April 26, 2011
 Vladimir Kazeev
 vladimir.kazeev@gmail.com
 INM RAS
 Moscow, Russia</pre></div>

<!-- crossreference -->
<h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
This function calls:
<ul style="list-style-image:url(../../matlabicon.gif)">
<li><a href="../../tt2/@tt_matrix/size.html" class="code" title="function [sz] = size(tt)">size</a>	Mode sizes of the TT-matrix</li><li><a href="../../tt2/@tt_tensor/reshape.html" class="code" title="function [tt2]=reshape(tt1,sz,eps, rl, rr)">reshape</a>	Reshape of the TT-tensor</li><li><a href="../../tt2/@tt_tensor/size.html" class="code" title="function [sz] = size(tt,dim)">size</a>	Mode sizes of the TT-tensor</li></ul>
This function is called by:
<ul style="list-style-image:url(../../matlabicon.gif)">
<li><a href="tt_qcirc.html" class="code" title="function [tt]=tt_qcirc(x,d)">tt_qcirc</a>	returns the multilevel circulant matrix tt generated by the multi-dimensional input vector x</li><li><a href="tt_qltrtoepl.html" class="code" title="function [tt]=tt_qltrtoepl(x)">tt_qltrtoepl</a>	returns the multilevel lower-triangular Toeplitz matrix tt generated by the multi-dimensional input vector x</li><li><a href="tt_qtoepl.html" class="code" title="function [tt]=tt_qtoepl(x,d)">tt_qtoepl</a>	returns the multilevel Toeplitz matrix tt generated by the multi-dimensional input vector x</li><li><a href="tt_qtofull.html" class="code" title="function [ful]=tt_qtofull(tt,s)">tt_qtofull</a>	Returns a tensor _full_, given in a QTT decomposition _tt_,</li><li><a href="tt_qutrtoepl.html" class="code" title="function [tt]=tt_qltrtoepl(x)">tt_qutrtoepl</a>	returns the multilevel upper-triangular Toeplitz matrix tt generated by the multi-dimensional input vector x</li></ul>
<!-- crossreference -->



<h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function [tt]=tt_qreshape(tt,s,sz)</a>
0002 
0003 <span class="comment">% Reshapes the cores of the input (Q)TT representation.</span>
0004 <span class="comment">% s (scalar) is the number of mode indices in each core of the input representation;</span>
0005 <span class="comment">% sz is a matrix of size d x s1, where d is the number of cores and s1 is the number of mode indices in each core of the output representation;</span>
0006 <span class="comment">% sz(k,alpha) is the mode size of the alpha-th index in the k-th core of the output representation.</span>
0007 <span class="comment">% k-th component of prod(sz,2) is the overall numbers of mode degrees of freedom of the k-th core of the output representation</span>
0008 <span class="comment">%</span>
0009 <span class="comment">% April 26, 2011</span>
0010 <span class="comment">% Vladimir Kazeev</span>
0011 <span class="comment">% vladimir.kazeev@gmail.com</span>
0012 <span class="comment">% INM RAS</span>
0013 <span class="comment">% Moscow, Russia</span>
0014 <span class="comment">%</span>
0015 
0016 d=<a href="../../tt2/@tt_matrix/size.html" class="code" title="function [sz] = size(tt)">size</a>(tt,1);
0017 <span class="keyword">for</span> k=1:d
0018     szk=<a href="../../tt2/@tt_matrix/size.html" class="code" title="function [sz] = size(tt)">size</a>(tt{k});
0019     szk=[szk,ones(1,s)];
0020     szkr=szk(s+1:numel(szk));
0021     tt{k}=<a href="../../tt2/@tt_tensor/reshape.html" class="code" title="function [tt2]=reshape(tt1,sz,eps, rl, rr)">reshape</a>(tt{k},[sz(k,:),szkr]);
0022 <span class="keyword">end</span>
0023 
0024 <span class="keyword">return</span>
0025 <span class="keyword">end</span></pre></div>
<hr><address>Generated on Wed 08-Feb-2012 18:20:24 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
</body>
</html>